/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EnigmaUtils;

import Items.Coin;
import Items.Dynamite;
import Items.ExtraLife;
import Items.Item;
import Items.MagicWand;
import Items.Umbrella;
import Items.BlackBomb;
import Items.Key;
import Items.Spring;
import Items.WhiteBomb;

/**
 *
 * @author Snowangelic
 */
public class ItemFactory {
    public ItemFactory(){
    }

    public Item generateItem(String type){
        if(type==null) return null;
        else if(type.equals("")) return null;
        else if(type.equals("ExtraLife")) return new ExtraLife();
        else if(type.equals("Dynamite")) return new Dynamite();
        else if(type.equals("BlackBomb")) return new BlackBomb();
        else if(type.equals("WhiteBomb")) return new WhiteBomb();
        else if(type.equals("Coin")) return new Coin();
        else if(type.equals("MagicWand")) return new MagicWand();
        else if(type.equals("Umbrella")) return new Umbrella();
        else if(type.equals("Spring")) return new Spring();
        else if(type.equals("Key")) return new Key();
        else return null;
    }
}
